package test2;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;

public class client {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("zjc的电脑",6587);
        DataOutputStream dos = new DataOutputStream(socket.getOutputStream());
        dos.writeUTF("你好啊");
        socket.shutdownOutput();
        DataInputStream dis=new DataInputStream(socket.getInputStream());
        String s = dis.readUTF();
        System.out.println(s);
        dis.close();
        dos.close();

        socket.close();

    }
}
